<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Win32k: winsta.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Win32k
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00920.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a> &#124;
<a href="#var-members">变量</a>  </div>
  <div class="headertitle">
<div class="title">winsta.c 文件参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="a03629_source.html">precomp.h</a>&quot;</code><br />
</div>
<p><a href="a00920_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:add96f2117ee4fc50323e35faf60d70a4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#add96f2117ee4fc50323e35faf60d70a4">N_ELEM</a>(a)&#160;&#160;&#160;(sizeof(a)/sizeof(a[0]))</td></tr>
<tr class="separator:add96f2117ee4fc50323e35faf60d70a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a205593576c0d0e2b4b1a9fada6d23269"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a205593576c0d0e2b4b1a9fada6d23269">LAST_ELEM</a>(a)&#160;&#160;&#160;( (a) [ <a class="el" href="a00920.html#add96f2117ee4fc50323e35faf60d70a4">N_ELEM</a>(a) - 1 ] )</td></tr>
<tr class="separator:a205593576c0d0e2b4b1a9fada6d23269"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac07546c3d3bba861938e75c5a88cd9cd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#ac07546c3d3bba861938e75c5a88cd9cd">PLAST_ELEM</a>(a)&#160;&#160;&#160;(&amp;<a class="el" href="a00920.html#a205593576c0d0e2b4b1a9fada6d23269">LAST_ELEM</a>(a))</td></tr>
<tr class="separator:ac07546c3d3bba861938e75c5a88cd9cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a240ed2313e01cb1999bd7560d7036a69"><td class="memItemLeft" align="right" valign="top">HWINSTA&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a240ed2313e01cb1999bd7560d7036a69">xxxCreateWindowStation</a> (POBJECT_ATTRIBUTES ObjectAttributes, KPROCESSOR_MODE ProbeMode, <a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwDesiredAccess)</td></tr>
<tr class="separator:a240ed2313e01cb1999bd7560d7036a69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52385572b161b2766b06b623fc09148e"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a52385572b161b2766b06b623fc09148e">FreeWindowStation</a> (<a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a> pwinsta)</td></tr>
<tr class="separator:a52385572b161b2766b06b623fc09148e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37ab00f65440ec01c8999c5ffc68a3a7"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a37ab00f65440ec01c8999c5ffc68a3a7">DestroyWindowStation</a> (PEPROCESS Process, PVOID pobj, ACCESS_MASK amGranted, ULONG cProcessHandles, ULONG cSystemHandles)</td></tr>
<tr class="separator:a37ab00f65440ec01c8999c5ffc68a3a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae46a05ddbcf53f151472b9d1d05bcbf4"><td class="memItemLeft" align="right" valign="top">NTSTATUS&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#ae46a05ddbcf53f151472b9d1d05bcbf4">ParseWindowStation</a> (PVOID pContainerObject, POBJECT_TYPE pObjectType, PACCESS_STATE pAccessState, KPROCESSOR_MODE AccessMode, ULONG Attributes, PUNICODE_STRING pstrCompleteName, PUNICODE_STRING pstrRemainingName, PVOID Context OPTIONAL, PSECURITY_QUALITY_OF_SERVICE pqos, PVOID *pObject)</td></tr>
<tr class="separator:ae46a05ddbcf53f151472b9d1d05bcbf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad58fb06e96f2813ccf8912643d77d256"><td class="memItemLeft" align="right" valign="top">HWINSTA&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#ad58fb06e96f2813ccf8912643d77d256">_OpenWindowStation</a> (POBJECT_ATTRIBUTES ObjA, <a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwDesiredAccess)</td></tr>
<tr class="separator:ad58fb06e96f2813ccf8912643d77d256"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfe8857740e45d3d77811d96376a3887"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#acfe8857740e45d3d77811d96376a3887">xxxSetProcessWindowStation</a> (HWINSTA hwinsta)</td></tr>
<tr class="separator:acfe8857740e45d3d77811d96376a3887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb6375323216956379cf3a0d229a677b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#adb6375323216956379cf3a0d229a677b">_GetProcessWindowStation</a> (HWINSTA *phwinsta)</td></tr>
<tr class="separator:adb6375323216956379cf3a0d229a677b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae191ae5ce0ac3c0f057cad729742a2d7"><td class="memItemLeft" align="right" valign="top">NTSTATUS&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#ae191ae5ce0ac3c0f057cad729742a2d7">_BuildNameList</a> (<a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a> pwinsta, <a class="el" href="a00365.html#a3fcd78b159328222536a29b4b050e283">PNAMELIST</a> pNameList, <a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> cbNameList, PUINT pcbNeeded)</td></tr>
<tr class="separator:ae191ae5ce0ac3c0f057cad729742a2d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71df3543eaf0197b0e7f280be312c854"><td class="memItemLeft" align="right" valign="top">NTSTATUS&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a71df3543eaf0197b0e7f280be312c854">ReferenceWindowStation</a> (<a class="el" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread, HWINSTA hwinsta, ACCESS_MASK amDesiredAccess, <a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a> *ppwinsta, BOOL fUseDesktop)</td></tr>
<tr class="separator:a71df3543eaf0197b0e7f280be312c854"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6623223c60ab90fdf12564f9f8e23bd4"><td class="memItemLeft" align="right" valign="top">NTSTATUS&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a6623223c60ab90fdf12564f9f8e23bd4">_UserGetGlobalAtomTable</a> (<a class="el" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread, HWINSTA hwinsta, PVOID *ppGlobalAtomTable)</td></tr>
<tr class="separator:a6623223c60ab90fdf12564f9f8e23bd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57282011f2303f6b1156be0fd31e6a1e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a57282011f2303f6b1156be0fd31e6a1e">_SetWindowStationUser</a> (<a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a> pwinsta, PLUID pluidUser, PSID psidUser, <a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> cbsidUser)</td></tr>
<tr class="separator:a57282011f2303f6b1156be0fd31e6a1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
变量</h2></td></tr>
<tr class="memitem:a8d75c1089327cdddcdff3c2a4890395d"><td class="memItemLeft" align="right" valign="top">static LPCWSTR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00920.html#a8d75c1089327cdddcdff3c2a4890395d">lpszStdFormats</a> []</td></tr>
<tr class="separator:a8d75c1089327cdddcdff3c2a4890395d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">宏定义说明</h2>
<a id="a205593576c0d0e2b4b1a9fada6d23269"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a205593576c0d0e2b4b1a9fada6d23269">&#9670;&nbsp;</a></span>LAST_ELEM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LAST_ELEM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a</td><td>)</td>
          <td>&#160;&#160;&#160;( (a) [ <a class="el" href="a00920.html#add96f2117ee4fc50323e35faf60d70a4">N_ELEM</a>(a) - 1 ] )</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00016">16</a> 行定义.</p>

</div>
</div>
<a id="add96f2117ee4fc50323e35faf60d70a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add96f2117ee4fc50323e35faf60d70a4">&#9670;&nbsp;</a></span>N_ELEM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define N_ELEM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a</td><td>)</td>
          <td>&#160;&#160;&#160;(sizeof(a)/sizeof(a[0]))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00015">15</a> 行定义.</p>

</div>
</div>
<a id="ac07546c3d3bba861938e75c5a88cd9cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac07546c3d3bba861938e75c5a88cd9cd">&#9670;&nbsp;</a></span>PLAST_ELEM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PLAST_ELEM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a</td><td>)</td>
          <td>&#160;&#160;&#160;(&amp;<a class="el" href="a00920.html#a205593576c0d0e2b4b1a9fada6d23269">LAST_ELEM</a>(a))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00017">17</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="ae191ae5ce0ac3c0f057cad729742a2d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae191ae5ce0ac3c0f057cad729742a2d7">&#9670;&nbsp;</a></span>_BuildNameList()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NTSTATUS _BuildNameList </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a>&#160;</td>
          <td class="paramname"><em>pwinsta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00365.html#a3fcd78b159328222536a29b4b050e283">PNAMELIST</a>&#160;</td>
          <td class="paramname"><em>pNameList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td>
          <td class="paramname"><em>cbNameList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUINT&#160;</td>
          <td class="paramname"><em>pcbNeeded</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00918">918</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;{</div>
<div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;    PBYTE pobj;</div>
<div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;    PWCHAR pwchDest, pwchMax;</div>
<div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;    ACCESS_MASK amDesired;</div>
<div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;    POBJECT_HEADER pHead;</div>
<div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;    POBJECT_HEADER_NAME_INFO pNameInfo;</div>
<div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> iNext;</div>
<div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160; </div>
<div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;    pNameList-&gt;<a class="code" href="a02597.html#a0bb800c1cd2c6393f736881f24ae7ec7">cNames</a> = 0;</div>
<div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;    pwchDest = pNameList-&gt;<a class="code" href="a02597.html#ab21ea6b07c2a49792115c1f21706a251">awchNames</a>;</div>
<div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;    pwchMax = (PWCHAR)((PBYTE)pNameList + cbNameList - <span class="keyword">sizeof</span>(WCHAR));</div>
<div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160; </div>
<div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;<span class="comment">     * If we&#39;re enumerating windowstations, pwinsta is NULL.  Otherwise,</span></div>
<div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;<span class="comment">     * we&#39;re enumerating desktops.</span></div>
<div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;    <span class="keywordflow">if</span> (pwinsta == NULL) {</div>
<div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;        pobj = (PBYTE)<a class="code" href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a>;</div>
<div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;        amDesired = WINSTA_ENUMERATE;</div>
<div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;        iNext = FIELD_OFFSET(<a class="code" href="a02809.html">WINDOWSTATION</a>, rpwinstaNext);</div>
<div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;        pobj = (PBYTE)pwinsta-&gt;<a class="code" href="a02809.html#aafbda282c78d875d4491cf817366dc1b">rpdeskList</a>;</div>
<div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;        amDesired = DESKTOP_ENUMERATE;</div>
<div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;        iNext = FIELD_OFFSET(<a class="code" href="a02801.html">DESKTOP</a>, rpdeskNext);</div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;    }</div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160; </div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;    Status = STATUS_SUCCESS;</div>
<div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;    *pcbNeeded = 0;</div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;    <span class="keywordflow">while</span> (pobj != NULL) {</div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160; </div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00839.html#a9f78afc46aa1b978b1ad2b0922e998e1">AccessCheckObject</a>(pobj, amDesired)) {</div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160; </div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;<span class="comment">             * Find object name</span></div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;            pHead = OBJECT_TO_OBJECT_HEADER(pobj);</div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;            pNameInfo = OBJECT_HEADER_TO_NAME_INFO(pHead);</div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160; </div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;<span class="comment">             * If we run out of space, reset the buffer</span></div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;<span class="comment">             * and continue so we can compute the needed</span></div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;<span class="comment">             * space.</span></div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;            <span class="keywordflow">if</span> ((PWCHAR)((PBYTE)pwchDest + pNameInfo-&gt;Name.Length +</div>
<div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;                    <span class="keyword">sizeof</span>(WCHAR)) &gt;= pwchMax) {</div>
<div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;                *pcbNeeded += (PBYTE)pwchDest - (PBYTE)pNameList;</div>
<div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;                pwchDest = pNameList-&gt;<a class="code" href="a02597.html#ab21ea6b07c2a49792115c1f21706a251">awchNames</a>;</div>
<div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160;                Status = STATUS_BUFFER_TOO_SMALL;</div>
<div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;            }</div>
<div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160; </div>
<div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;            pNameList-&gt;<a class="code" href="a02597.html#a0bb800c1cd2c6393f736881f24ae7ec7">cNames</a>++;</div>
<div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160; </div>
<div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160;<span class="comment">             * Copy and terminate the string</span></div>
<div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;            RtlCopyMemory(pwchDest, pNameInfo-&gt;Name.Buffer,</div>
<div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;                    pNameInfo-&gt;Name.Length);</div>
<div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;            (PBYTE)pwchDest += pNameInfo-&gt;Name.Length;</div>
<div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;            *pwchDest++ = 0;</div>
<div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;        }</div>
<div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160; </div>
<div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160;        pobj = *(PBYTE *)(pobj + iNext);</div>
<div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;    }</div>
<div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160; </div>
<div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;<span class="comment">     * Put an empty string on the end.</span></div>
<div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160;    *pwchDest++ = 0;</div>
<div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160; </div>
<div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;    pNameList-&gt;<a class="code" href="a02597.html#a9ed6a30359da8299f730bdf76bc44dbb">cb</a> = (PBYTE)pwchDest - (PBYTE)pNameList;</div>
<div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;    *pcbNeeded += (PBYTE)pwchDest - (PBYTE)pNameList;</div>
<div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160; </div>
<div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00839_source.html#l00517">AccessCheckObject()</a>, <a class="el" href="a00365_source.html#l01529">tagNAMELIST::awchNames</a>, <a class="el" href="a00365_source.html#l01527">tagNAMELIST::cb</a>, <a class="el" href="a00365_source.html#l01528">tagNAMELIST::cNames</a>, <a class="el" href="a00563_source.html#l00175">DWORD</a>, <a class="el" href="a03257_source.html#l00182">grpwinstaList</a> , 以及 <a class="el" href="a00899_source.html#l01746">tagWINDOWSTATION::rpdeskList</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l06606">NtUserBuildNameList()</a>.</p>

</div>
</div>
<a id="adb6375323216956379cf3a0d229a677b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb6375323216956379cf3a0d229a677b">&#9670;&nbsp;</a></span>_GetProcessWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a> _GetProcessWindowStation </td>
          <td>(</td>
          <td class="paramtype">HWINSTA *&#160;</td>
          <td class="paramname"><em>phwinsta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00891">891</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;{</div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread = PsGetCurrentThread();</div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi;</div>
<div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160; </div>
<div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160;    <span class="keywordflow">if</span> (Thread == NULL) {</div>
<div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(Thread);</div>
<div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00900"></a><span class="lineno">  900</span>&#160;    }</div>
<div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160; </div>
<div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;    ppi = PpiFromProcess(THREAD_TO_PROCESS(Thread));</div>
<div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;    <span class="keywordflow">if</span> (phwinsta)</div>
<div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;        *phwinsta = ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a>;</div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;    <span class="keywordflow">return</span> ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a>;</div>
<div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899_source.html#l02400">tagPROCESSINFO::hwinsta</a>, <a class="el" href="a00899_source.html#l02399">tagPROCESSINFO::rpwinsta</a> , 以及 <a class="el" href="a00950_source.html#l00117">UserAssert</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00704_source.html#l00144">_RegisterHotKey()</a>, <a class="el" href="a03614_source.html#l06652">NtUserActivateKeyboardLayout()</a>, <a class="el" href="a03614_source.html#l00776">NtUserCloseWindowStation()</a>, <a class="el" href="a03614_source.html#l09830">NtUserECQueryInputLangChange()</a>, <a class="el" href="a03614_source.html#l07176">NtUserGetKeyboardLayoutList()</a>, <a class="el" href="a03614_source.html#l00810">NtUserGetProcessWindowStation()</a>, <a class="el" href="a03614_source.html#l06667">NtUserLoadKeyboardLayoutEx()</a>, <a class="el" href="a03614_source.html#l00884">NtUserOpenInputDesktop()</a>, <a class="el" href="a03614_source.html#l06714">NtUserUnloadKeyboardLayout()</a>, <a class="el" href="a00689_source.html#l00793">ResetSharedDesktops()</a>, <a class="el" href="a00671_source.html#l01146">xxxDefWindowProc()</a>, <a class="el" href="a00824_source.html#l01766">xxxDestroyThreadInfo()</a>, <a class="el" href="a00635_source.html#l01676">xxxDW_SendDestroyMessages()</a>, <a class="el" href="a00635_source.html#l01817">xxxFreeWindow()</a> , 以及 <a class="el" href="a00656_source.html#l02349">xxxSwitchDesktop()</a>.</p>

</div>
</div>
<a id="ad58fb06e96f2813ccf8912643d77d256"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad58fb06e96f2813ccf8912643d77d256">&#9670;&nbsp;</a></span>_OpenWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HWINSTA _OpenWindowStation </td>
          <td>(</td>
          <td class="paramtype">POBJECT_ATTRIBUTES&#160;</td>
          <td class="paramname"><em>ObjA</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>&#160;</td>
          <td class="paramname"><em>dwDesiredAccess</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00690">690</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;{</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;    HWINSTA hwinsta;</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160; </div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;    Status = ObOpenObjectByName(</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;            ObjA,</div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;            *<a class="code" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>,</div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;            KeGetPreviousMode(),</div>
<div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;            NULL,</div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;            dwDesiredAccess,</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;            NULL,</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;            &amp;hwinsta);</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;        <a class="code" href="a00371.html#a002956db9fb529e159fb441f09f39b42">RIPNTERR0</a>(Status, <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;        hwinsta = NULL;</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;    }</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;    <span class="keywordflow">return</span> hwinsta;</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>, <a class="el" href="a00371_source.html#l00030">RIP_VERBOSE</a> , 以及 <a class="el" href="a00371_source.html#l00125">RIPNTERR0</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00839_source.html#l00296">_UserTestForWinStaAccess()</a>, <a class="el" href="a03614_source.html#l00696">NtUserOpenWindowStation()</a> , 以及 <a class="el" href="a00656_source.html#l03342">xxxResolveDesktop()</a>.</p>

</div>
</div>
<a id="a57282011f2303f6b1156be0fd31e6a1e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57282011f2303f6b1156be0fd31e6a1e">&#9670;&nbsp;</a></span>_SetWindowStationUser()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> _SetWindowStationUser </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a>&#160;</td>
          <td class="paramname"><em>pwinsta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PLUID&#160;</td>
          <td class="paramname"><em>pluidUser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PSID&#160;</td>
          <td class="paramname"><em>psidUser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>&#160;</td>
          <td class="paramname"><em>cbsidUser</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l01141">1141</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;{</div>
<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160; </div>
<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160;<span class="comment">     * Make sure the caller is the logon process</span></div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160;    <span class="keywordflow">if</span> (GetCurrentProcessId() != <a class="code" href="a03257.html#ad4b0bbbb1f1fce28a4e874ae6fb92262">gpidLogon</a>) {</div>
<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160;        <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_ACCESS_DENIED,</div>
<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160;                <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;                <span class="stringliteral">&quot;Access denied in _SetWindowStationUser: caller must be in the logon process&quot;</span>);</div>
<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160; </div>
<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>&#160;    }</div>
<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>&#160; </div>
<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a> != NULL)</div>
<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>&#160;        UserFreePool(pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a>);</div>
<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>&#160; </div>
<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160;    <span class="keywordflow">if</span> (psidUser != NULL) {</div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;        pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a> = UserAllocPoolWithQuota(cbsidUser, TAG_SECURITY);</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;        <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a> == NULL) {</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;            <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_OUTOFMEMORY,</div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160;                    <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;                    <span class="stringliteral">&quot;Memory allocation failed in _SetWindowStationUser&quot;</span>);</div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160; </div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>&#160;        }</div>
<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160;            RtlCopyMemory(pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a>, psidUser, cbsidUser);</div>
<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;        } except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>&#160;            <a class="code" href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a>(ERROR_INVALID_PARAMETER,</div>
<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>&#160;                    <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>&#160;                    <span class="stringliteral">&quot;Invalid parameter \&quot;psidUser\&quot; (%#lx) to _SetWindowStationUser&quot;</span>,</div>
<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;                    psidUser);</div>
<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160; </div>
<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;            UserFreePool(pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a>);</div>
<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;            pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a> = NULL;</div>
<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160;        }</div>
<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>&#160;        pwinsta-&gt;<a class="code" href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">psidUser</a> = NULL;</div>
<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;    }</div>
<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160; </div>
<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160;    pwinsta-&gt;<a class="code" href="a02809.html#a384d45dfef3f95188b5c7a7a09213d35">luidUser</a> = *pluidUser;</div>
<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160; </div>
<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a03257_source.html#l00183">gpidLogon</a>, <a class="el" href="a00899_source.html#l01784">tagWINDOWSTATION::luidUser</a>, <a class="el" href="a00899_source.html#l01785">tagWINDOWSTATION::psidUser</a>, <a class="el" href="a00371_source.html#l00029">RIP_WARNING</a>, <a class="el" href="a00371_source.html#l00119">RIPERR0</a> , 以及 <a class="el" href="a00371_source.html#l00120">RIPERR1</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l05616">NtUserSetWindowStationUser()</a>.</p>

</div>
</div>
<a id="a6623223c60ab90fdf12564f9f8e23bd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6623223c60ab90fdf12564f9f8e23bd4">&#9670;&nbsp;</a></span>_UserGetGlobalAtomTable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NTSTATUS _UserGetGlobalAtomTable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a>&#160;</td>
          <td class="paramname"><em>Thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HWINSTA&#160;</td>
          <td class="paramname"><em>hwinsta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PVOID *&#160;</td>
          <td class="paramname"><em>ppGlobalAtomTable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l01093">1093</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;{</div>
<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinsta;</div>
<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;    PVOID GlobalAtomTable;</div>
<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160; </div>
<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160;    GlobalAtomTable = NULL;</div>
<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>&#160;    <span class="keywordflow">if</span> (hwinsta == NULL) {</div>
<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>&#160;        hwinsta = PsGetCurrentProcess()-&gt;Win32WindowStation;</div>
<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>&#160;    }</div>
<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>&#160;    pwinsta = NULL;</div>
<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>&#160;    Status = <a class="code" href="a00920.html#a71df3543eaf0197b0e7f280be312c854">ReferenceWindowStation</a>(Thread, hwinsta,</div>
<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>&#160;            WINSTA_ACCESSGLOBALATOMS, &amp;pwinsta, TRUE);</div>
<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>&#160;    <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>&#160;            GlobalAtomTable = pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a>;</div>
<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160;            *ppGlobalAtomTable = pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a>;</div>
<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160;        } except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>&#160;            Status = GetExceptionCode();</div>
<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;        }</div>
<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;    }</div>
<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160; </div>
<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status) || GlobalAtomTable == NULL) {</div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160;        <a class="code" href="a00371.html#af713eb6f9b50ac607c1fed71a5f678f8">RIPMSG3</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>,</div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;                <span class="stringliteral">&quot;_UserGetGlobalAtomTable: NULL Atom Table (hwinsta=0x%X, pwinsta=0x%X, Status=0x%08X)&quot;</span>,</div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;                 hwinsta,</div>
<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;                 pwinsta,</div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;                 Status);</div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;    }</div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160; </div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899_source.html#l01780">tagWINDOWSTATION::pGlobalAtomTable</a>, <a class="el" href="a00920_source.html#l00999">ReferenceWindowStation()</a>, <a class="el" href="a00371_source.html#l00028">RIP_ERROR</a> , 以及 <a class="el" href="a00371_source.html#l00134">RIPMSG3</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03665_source.html#l02334">UserGlobalAtomTableCallout()</a>.</p>

</div>
</div>
<a id="a37ab00f65440ec01c8999c5ffc68a3a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37ab00f65440ec01c8999c5ffc68a3a7">&#9670;&nbsp;</a></span>DestroyWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID DestroyWindowStation </td>
          <td>(</td>
          <td class="paramtype">PEPROCESS&#160;</td>
          <td class="paramname"><em>Process</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PVOID&#160;</td>
          <td class="paramname"><em>pobj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ACCESS_MASK&#160;</td>
          <td class="paramname"><em>amGranted</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ULONG&#160;</td>
          <td class="paramname"><em>cProcessHandles</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ULONG&#160;</td>
          <td class="paramname"><em>cSystemHandles</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00545">545</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;{</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinsta = pobj;</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> *ppwinsta;</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdesk;</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdeskLock = NULL;</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    BOOL fReenter;</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160; </div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;<span class="comment">     * If this is not the last handle, leave</span></div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;    <span class="keywordflow">if</span> (cSystemHandles != 1)</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160; </div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;<span class="comment">     * If we do not own the resource, get it now</span></div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    fReenter = !ExIsResourceAcquiredExclusiveLite(<a class="code" href="a03257.html#ac6b62aff5aa60b8f170320cd7c3f32d7">gpresUser</a>);</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;    <span class="keywordflow">if</span> (fReenter)</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160; </div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;<span class="comment">     * Unlink the object</span></div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;    <span class="keywordflow">for</span> (ppwinsta = &amp;<a class="code" href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a>; pwinsta != *ppwinsta;</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;            ppwinsta = &amp;(*ppwinsta)-&gt;<a class="code" href="a02809.html#acdccfdf2387c6fcf147bba1ee15d5939">rpwinstaNext</a>)</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;        ;</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;    UnlockWinSta(ppwinsta);</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    *ppwinsta = pwinsta-&gt;<a class="code" href="a02809.html#acdccfdf2387c6fcf147bba1ee15d5939">rpwinstaNext</a>;</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160; </div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;<span class="comment">     * Close the switch event</span></div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a28454439608f1b5501948513679e4f42">hEventSwitchNotify</a>) {</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        KeAttachProcess(&amp;<a class="code" href="a03257.html#a5bcbaef1c421c1998d7ea053444e3fc2">gpepSystem</a>-&gt;Pcb);</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;        ZwClose(pwinsta-&gt;<a class="code" href="a02809.html#a28454439608f1b5501948513679e4f42">hEventSwitchNotify</a>);</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        KeDetachProcess();</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;    }</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160; </div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;<span class="comment">     * Notify all console threads and wait for them to</span></div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;<span class="comment">     * terminate.</span></div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;    pdesk = pwinsta-&gt;<a class="code" href="a02809.html#aafbda282c78d875d4491cf817366dc1b">rpdeskList</a>;</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;    <span class="keywordflow">while</span> (pdesk != NULL) {</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;        <span class="keywordflow">if</span> (pdesk != pwinsta-&gt;<a class="code" href="a02809.html#ab47ad82730b6b8c717b1444a018bc499">rpdeskLogon</a> &amp;&amp; pdesk-&gt;<a class="code" href="a02801.html#aa5a1d482d42aa7bc00013ae77771910a">dwConsoleThreadId</a>) {</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;            LockDesktop(&amp;pdeskLock, pdesk);</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;            <a class="code" href="a00656.html#a3de14821d9e99f6989747d92e181d117">TerminateConsole</a>(pdesk);</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160; </div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;<span class="comment">             * Restart scan in case desktop list has changed</span></div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;            pdesk = pwinsta-&gt;<a class="code" href="a02809.html#aafbda282c78d875d4491cf817366dc1b">rpdeskList</a>;</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;            UnlockDesktop(&amp;pdeskLock);</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;        } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;            pdesk = pdesk-&gt;<a class="code" href="a02801.html#ace92d08d0736aef3f0b73273a6e3e5f7">rpdeskNext</a>;</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;    }</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160; </div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;    <span class="keywordflow">if</span> (fReenter)</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899_source.html#l01725">tagDESKTOP::dwConsoleThreadId</a>, <a class="el" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit()</a>, <a class="el" href="a03257_source.html#l00184">gpepSystem</a>, <a class="el" href="a03257_source.html#l00169">gpresUser</a>, <a class="el" href="a03257_source.html#l00182">grpwinstaList</a>, <a class="el" href="a00899_source.html#l01787">tagWINDOWSTATION::hEventSwitchNotify</a>, <a class="el" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit()</a>, <a class="el" href="a00899_source.html#l01746">tagWINDOWSTATION::rpdeskList</a>, <a class="el" href="a00899_source.html#l01747">tagWINDOWSTATION::rpdeskLogon</a>, <a class="el" href="a00899_source.html#l01709">tagDESKTOP::rpdeskNext</a>, <a class="el" href="a00899_source.html#l01745">tagWINDOWSTATION::rpwinstaNext</a> , 以及 <a class="el" href="a00656_source.html#l03233">TerminateConsole()</a>.</p>

</div>
</div>
<a id="a52385572b161b2766b06b623fc09148e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52385572b161b2766b06b623fc09148e">&#9670;&nbsp;</a></span>FreeWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID FreeWindowStation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a>&#160;</td>
          <td class="paramname"><em>pwinsta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00447">447</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;{</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinstaLock = NULL;</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    BOOL fAlreadyHadCrit;</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160; </div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;<span class="comment">     * Mark the windowstation as dying.  Make sure we&#39;re not recursing.</span></div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!(pwinsta-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp; WSF_DYING));</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    pwinsta-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> |= WSF_DYING;</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160; </div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pwinsta-&gt;<a class="code" href="a02809.html#aafbda282c78d875d4491cf817366dc1b">rpdeskList</a> == NULL);</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160; </div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;<span class="comment">     * Free up the other resources</span></div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#afda7868778766e7b9c8cd875b6e83b59">pEventInputReady</a> != NULL) {</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;        KeSetEvent(pwinsta-&gt;<a class="code" href="a02809.html#afda7868778766e7b9c8cd875b6e83b59">pEventInputReady</a>, EVENT_INCREMENT, FALSE);</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;        ObDereferenceObject(pwinsta-&gt;<a class="code" href="a02809.html#afda7868778766e7b9c8cd875b6e83b59">pEventInputReady</a>);</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;        pwinsta-&gt;<a class="code" href="a02809.html#afda7868778766e7b9c8cd875b6e83b59">pEventInputReady</a> = NULL;</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    }</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">pEventSwitchNotify</a> != NULL) {</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;        KeSetEvent(pwinsta-&gt;<a class="code" href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">pEventSwitchNotify</a>, EVENT_INCREMENT, FALSE);</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;        ObDereferenceObject(pwinsta-&gt;<a class="code" href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">pEventSwitchNotify</a>);</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;        pwinsta-&gt;<a class="code" href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">pEventSwitchNotify</a> = NULL;</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;    }</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160; </div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;<span class="comment">     * Make sure that we have the user lock.</span></div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;    fAlreadyHadCrit = ExIsResourceAcquiredExclusiveLite(<a class="code" href="a03257.html#ac6b62aff5aa60b8f170320cd7c3f32d7">gpresUser</a>);</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;    <span class="keywordflow">if</span> (fAlreadyHadCrit == FALSE) {</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;    }</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160; </div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;    RtlDestroyAtomTable(pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a>);</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160; </div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;    <a class="code" href="a00632.html#a597334dbd8f7414342f9b405aef21c9e">ForceEmptyClipboard</a>(pwinsta);</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160; </div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;<span class="comment">     * Free up keyboard layouts</span></div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;    <span class="keywordflow">if</span> (!(pwinsta-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp; WSF_NOIO))</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;        <a class="code" href="a00725.html#a5618df359d17a210e0812e1bd431d43f">xxxFreeKeyboardLayouts</a>(pwinsta);</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160; </div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;<span class="comment">     * Kill desktop thread.</span></div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pwinsta-&gt;<a class="code" href="a02809.html#a5734cf57c3cd916ca3c74b17b7c6f39e">spwndLogonNotify</a> == NULL);</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a> != NULL) {</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160; </div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;        <a class="code" href="a03290.html#a7bb16e9d18954c3ef50ae8bc75f89c5d">_PostThreadMessage</a>(pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a>, WM_QUIT, 0, 0);</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160; </div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;<span class="comment">         * Unlock the desktop owner window and allow the</span></div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;<span class="comment">         * desktop thread to destroy it.</span></div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;        Unlock(&amp;pwinsta-&gt;<a class="code" href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">spwndDesktopOwner</a>);</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160; </div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;<span class="comment">         * We used to leave the critical section and wait here</span></div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;<span class="comment">         *  for the desktop thread to go away.</span></div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;<span class="comment">         * This call usually happens while processing DeleteThreadInfo,</span></div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;<span class="comment">         *  so waiting for the desktop thread to go away might hang the</span></div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;<span class="comment">         *  kernel if another system thread is trying to exit at the</span></div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;<span class="comment">         *  same time. This can happen while shutting down a service</span></div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;<span class="comment">         *  process that creates a window station.</span></div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;<span class="comment">         *  All desktops must be gone or we wouldn&#39;t be here. In other</span></div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;<span class="comment">         *   words, nobody should need this winstation anymore; it</span></div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;<span class="comment">         *   should be OK to go on without waiting.</span></div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;<span class="comment">         *  Let&#39;s make sure nobody grabs this pwinsta though.</span></div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160; </div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pwinsta == pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a>-&gt;<a class="code" href="a02889.html#a9e724dc18abf3bc851b0f9896bb843be">pwinsta</a>);</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;        pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a>-&gt;<a class="code" href="a02889.html#a9e724dc18abf3bc851b0f9896bb843be">pwinsta</a> = NULL;</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;   }</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160; </div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;   <span class="keywordflow">if</span> (fAlreadyHadCrit == FALSE) {</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;       <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;   }</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160; </div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a03290_source.html#l01064">_PostThreadMessage()</a>, <a class="el" href="a00899_source.html#l01758">tagWINDOWSTATION::dwFlags</a>, <a class="el" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit()</a>, <a class="el" href="a00632_source.html#l02189">ForceEmptyClipboard()</a>, <a class="el" href="a03257_source.html#l00169">gpresUser</a>, <a class="el" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit()</a>, <a class="el" href="a00899_source.html#l01762">tagWINDOWSTATION::pEventInputReady</a>, <a class="el" href="a00899_source.html#l01782">tagWINDOWSTATION::pEventSwitchNotify</a>, <a class="el" href="a00899_source.html#l01780">tagWINDOWSTATION::pGlobalAtomTable</a>, <a class="el" href="a00899_source.html#l01757">tagWINDOWSTATION::ptiDesktop</a>, <a class="el" href="a00899_source.html#l02316">tagTHREADINFO::pwinsta</a>, <a class="el" href="a00899_source.html#l01746">tagWINDOWSTATION::rpdeskList</a>, <a class="el" href="a00899_source.html#l01755">tagWINDOWSTATION::spwndDesktopOwner</a>, <a class="el" href="a00899_source.html#l01756">tagWINDOWSTATION::spwndLogonNotify</a>, <a class="el" href="a00950_source.html#l00117">UserAssert</a> , 以及 <a class="el" href="a00725_source.html#l00952">xxxFreeKeyboardLayouts()</a>.</p>

</div>
</div>
<a id="ae46a05ddbcf53f151472b9d1d05bcbf4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae46a05ddbcf53f151472b9d1d05bcbf4">&#9670;&nbsp;</a></span>ParseWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NTSTATUS ParseWindowStation </td>
          <td>(</td>
          <td class="paramtype">PVOID&#160;</td>
          <td class="paramname"><em>pContainerObject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">POBJECT_TYPE&#160;</td>
          <td class="paramname"><em>pObjectType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PACCESS_STATE&#160;</td>
          <td class="paramname"><em>pAccessState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">KPROCESSOR_MODE&#160;</td>
          <td class="paramname"><em>AccessMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ULONG&#160;</td>
          <td class="paramname"><em>Attributes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUNICODE_STRING&#160;</td>
          <td class="paramname"><em>pstrCompleteName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUNICODE_STRING&#160;</td>
          <td class="paramname"><em>pstrRemainingName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PVOID Context&#160;</td>
          <td class="paramname"><em>OPTIONAL</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PSECURITY_QUALITY_OF_SERVICE&#160;</td>
          <td class="paramname"><em>pqos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PVOID *&#160;</td>
          <td class="paramname"><em>pObject</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00622">622</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;{</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinsta = pContainerObject;</div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160; </div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;<span class="comment">     * If nothing remains to be parsed, return the windowstation.</span></div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;    *pObject = NULL;</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;    <span class="keywordflow">if</span> (pstrRemainingName-&gt;Length == 0) {</div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;        <span class="keywordflow">if</span> (pObjectType != *<a class="code" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>)</div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;            <span class="keywordflow">return</span> STATUS_OBJECT_TYPE_MISMATCH;</div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160; </div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;        ObReferenceObject(pwinsta);</div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;        *pObject = pwinsta;</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;        <span class="keywordflow">return</span> STATUS_SUCCESS;</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;    }</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160; </div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;<span class="comment">     * Skip leading path separator, if present.</span></div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;    <span class="keywordflow">if</span> (*(pstrRemainingName-&gt;Buffer) == OBJ_NAME_PATH_SEPARATOR) {</div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;        pstrRemainingName-&gt;Buffer++;</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;        pstrRemainingName-&gt;Length -= <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;        pstrRemainingName-&gt;MaximumLength -= <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;    }</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160; </div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;<span class="comment">     * Validate the desktop name.</span></div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;    <span class="keywordflow">if</span> (wcschr(pstrRemainingName-&gt;Buffer, L<span class="charliteral">&#39;\\&#39;</span>))</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;        <span class="keywordflow">return</span> STATUS_OBJECT_PATH_INVALID;</div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;    <span class="keywordflow">if</span> (pObjectType == *<a class="code" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>) {</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="a00656.html#a02f3707bdf26cc51a2b852ba3dc46fd1">ParseDesktop</a>(</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;                pContainerObject,</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;                pObjectType,</div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;                pAccessState,</div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;                AccessMode,</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;                Attributes,</div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;                pstrCompleteName,</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;                pstrRemainingName,</div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;                Context,</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;                pqos,</div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;                pObject);</div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;    }</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160; </div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;    <span class="keywordflow">return</span> STATUS_OBJECT_TYPE_MISMATCH;</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>, <a class="el" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a> , 以及 <a class="el" href="a00656_source.html#l01596">ParseDesktop()</a>.</p>

</div>
</div>
<a id="a71df3543eaf0197b0e7f280be312c854"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71df3543eaf0197b0e7f280be312c854">&#9670;&nbsp;</a></span>ReferenceWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NTSTATUS ReferenceWindowStation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a>&#160;</td>
          <td class="paramname"><em>Thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HWINSTA&#160;</td>
          <td class="paramname"><em>hwinsta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ACCESS_MASK&#160;</td>
          <td class="paramname"><em>amDesiredAccess</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00365.html#a0d80f75801f7be76834d65980cdc857e">PWINDOWSTATION</a> *&#160;</td>
          <td class="paramname"><em>ppwinsta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BOOL&#160;</td>
          <td class="paramname"><em>fUseDesktop</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00999">999</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;{</div>
<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi;</div>
<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinsta = NULL;</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160; </div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160;<span class="comment">     * We prefer to use the thread&#39;s desktop to dictate which</span></div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;<span class="comment">     * windowstation/Atom table to use rather than the process.</span></div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;<span class="comment">     * This allows NetDDE, which has threads running under</span></div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;<span class="comment">     * different desktops on different windowstations but whos</span></div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;<span class="comment">     * process is set to only one of these windowstations, to</span></div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;<span class="comment">     * get global atoms properly without having to change its</span></div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;<span class="comment">     * process windowstation a billion times and synchronize.</span></div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;    ppi = PpiFromProcess(Thread-&gt;ThreadsProcess);</div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;    pti = PtiFromThread(Thread);</div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160; </div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;<span class="comment">     * First, try to get the windowstation from the pti, and then</span></div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;<span class="comment">     * from the ppi.</span></div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;    <span class="keywordflow">if</span> (ppi != NULL) {</div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;        <span class="keywordflow">if</span> (!fUseDesktop || pti == NULL || pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> == NULL ||</div>
<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;                ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a> == pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#aec6cab8a48f05b1fd77850a34109675e">rpwinstaParent</a>) {</div>
<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160; </div>
<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160;<span class="comment">             * Use the windowstation assigned to the process.</span></div>
<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160;            pwinsta = ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a>;</div>
<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160;            <span class="keywordflow">if</span> (pwinsta != NULL) {</div>
<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160;                RETURN_IF_ACCESS_DENIED(ppi-&gt;<a class="code" href="a02905.html#a31c3805f3b611723d2ce7b28d87c6859">amwinsta</a>, amDesiredAccess,</div>
<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160;                        STATUS_ACCESS_DENIED);</div>
<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160;            }</div>
<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160;        }</div>
<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160; </div>
<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160;<span class="comment">         * If we aren&#39;t using the process&#39; windowstation, try to</span></div>
<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160;<span class="comment">         * go through the thread&#39;s desktop.</span></div>
<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160;        <span class="keywordflow">if</span> (pwinsta == NULL &amp;&amp; pti != NULL &amp;&amp; pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> != NULL) {</div>
<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160; </div>
<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;<span class="comment">             * Perform access check the parent windowstation.  This</span></div>
<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160;<span class="comment">             * is an expensive operation.</span></div>
<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;            pwinsta = pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#aec6cab8a48f05b1fd77850a34109675e">rpwinstaParent</a>;</div>
<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;            <span class="keywordflow">if</span> (!<a class="code" href="a00839.html#a9f78afc46aa1b978b1ad2b0922e998e1">AccessCheckObject</a>(pwinsta, amDesiredAccess))</div>
<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;                <span class="keywordflow">return</span> STATUS_ACCESS_DENIED;</div>
<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;        }</div>
<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160;    }</div>
<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160; </div>
<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160;<span class="comment">     * If we still don&#39;t have a windowstation and a handle was</span></div>
<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>&#160;<span class="comment">     * passed in, use it.</span></div>
<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>&#160;    <span class="keywordflow">if</span> (pwinsta == NULL) {</div>
<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>&#160;        <span class="keywordflow">if</span> (hwinsta != NULL) {</div>
<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>&#160;            Status = ObReferenceObjectByHandle(</div>
<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>&#160;                    hwinsta,</div>
<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>&#160;                    amDesiredAccess,</div>
<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>&#160;                    *<a class="code" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>,</div>
<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>&#160;                    KeGetPreviousMode(),</div>
<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>&#160;                    &amp;pwinsta,</div>
<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>&#160;                    NULL);</div>
<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>&#160;            <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>&#160;                <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>&#160;            ObDereferenceObject(pwinsta);</div>
<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>&#160;            <span class="keywordflow">return</span> STATUS_NOT_FOUND;</div>
<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>&#160;        }</div>
<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>&#160;    }</div>
<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>&#160; </div>
<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>&#160;    *ppwinsta = pwinsta;</div>
<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>&#160; </div>
<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>&#160;    <span class="keywordflow">return</span> STATUS_SUCCESS;</div>
<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00839_source.html#l00517">AccessCheckObject()</a>, <a class="el" href="a00899_source.html#l02401">tagPROCESSINFO::amwinsta</a>, <a class="el" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>, <a class="el" href="a00899_source.html#l02288">tagTHREADINFO::rpdesk</a>, <a class="el" href="a00899_source.html#l02399">tagPROCESSINFO::rpwinsta</a> , 以及 <a class="el" href="a00899_source.html#l01710">tagDESKTOP::rpwinstaParent</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00920_source.html#l01093">_UserGetGlobalAtomTable()</a>, <a class="el" href="a00632_source.html#l00050">CheckClipboardAccess()</a> , 以及 <a class="el" href="a00857_source.html#l00028">xxxSnapWindow()</a>.</p>

</div>
</div>
<a id="a240ed2313e01cb1999bd7560d7036a69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a240ed2313e01cb1999bd7560d7036a69">&#9670;&nbsp;</a></span>xxxCreateWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HWINSTA xxxCreateWindowStation </td>
          <td>(</td>
          <td class="paramtype">POBJECT_ATTRIBUTES&#160;</td>
          <td class="paramname"><em>ObjectAttributes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">KPROCESSOR_MODE&#160;</td>
          <td class="paramname"><em>ProbeMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>&#160;</td>
          <td class="paramname"><em>dwDesiredAccess</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00055">55</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    RTL_ATOM Atom;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinsta, *ppwinsta;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <a class="code" href="a02813.html">DESKTOPTHREADINIT</a> dti;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    HANDLE hThreadDesktop;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdeskTemp;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    HDESK hdeskTemp;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    PSECURITY_DESCRIPTOR psd;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    PSECURITY_DESCRIPTOR psdCapture;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppiSave;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    PACCESS_ALLOWED_ACE paceList = NULL, pace;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    ULONG i, ulLength, ulLengthSid;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    HANDLE hEvent;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    HWINSTA hwinsta;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwDisableHooks;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keyword">static</span> BOOL fOneTimeInit = FALSE;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="comment">     * Get the pointer to the security descriptor so we can</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment">     * assign it to the new object later.</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        psdCapture = ObjectAttributes-&gt;SecurityDescriptor;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    } except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <a class="code" href="a00371.html#a002956db9fb529e159fb441f09f39b42">RIPNTERR0</a>(GetExceptionCode(), <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    Status = ObCreateObject(ProbeMode, *<a class="code" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>,</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            ObjectAttributes, ProbeMode, NULL, <span class="keyword">sizeof</span>(<a class="code" href="a02809.html">WINDOWSTATION</a>),</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            0, 0, &amp;pwinsta);</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <a class="code" href="a00371.html#a002956db9fb529e159fb441f09f39b42">RIPNTERR0</a>(Status, <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    RtlZeroMemory(pwinsta, <span class="keyword">sizeof</span>(<a class="code" href="a02809.html">WINDOWSTATION</a>));</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment">     * Initialize everything</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    pwinsta-&gt;<a class="code" href="a02809.html#aafbda282c78d875d4491cf817366dc1b">rpdeskList</a> = NULL;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    pwinsta-&gt;<a class="code" href="a02809.html#a1a2b3b6fc0e04fcb8253ca5bb00c631e">pwchDiacritic</a> = <a class="code" href="a00920.html#ac07546c3d3bba861938e75c5a88cd9cd">PLAST_ELEM</a>(pwinsta-&gt;<a class="code" href="a02809.html#ae2b5d692d111668887615069be07738c">awchDiacritic</a>);</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment">     * Only allow the first instance to do I/O</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordflow">if</span> (fOneTimeInit)</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        pwinsta-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> = WSF_NOIO;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment">     * Create the global atom table and populate it with the default OLE atoms</span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="comment">     * Pin each atom so they can&#39;t be deleted by bogus applications like Winword</span></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    Status = RtlCreateAtomTable( 0, &amp;pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a> );</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">for</span> (i=0; <a class="code" href="a00920.html#a8d75c1089327cdddcdff3c2a4890395d">lpszStdFormats</a>[i] != NULL; i++) {</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        Status = RtlAddAtomToAtomTable( pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a>,</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                                        (PWSTR)<a class="code" href="a00920.html#a8d75c1089327cdddcdff3c2a4890395d">lpszStdFormats</a>[i],</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                                        &amp;Atom</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                                      );</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        RtlPinAtomInAtomTable( pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a>, Atom );</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        <span class="keywordflow">if</span> (i==0) {</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;            <a class="code" href="a00371.html#af713eb6f9b50ac607c1fed71a5f678f8">RIPMSG3</a>(<a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>,</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                    <span class="stringliteral">&quot;Created atom table 0x%08lx for winsta 0x%08lx (First OLE atom is 0x%08lx)&quot;</span>,</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                     pwinsta-&gt;<a class="code" href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">pGlobalAtomTable</a>,</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                     pwinsta,</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                     Atom);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    }</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment">     * NT-specific stuff</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    pwinsta-&gt;<a class="code" href="a02809.html#ab47ad82730b6b8c717b1444a018bc499">rpdeskLogon</a> = NULL;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    Status = ZwCreateEvent(&amp;hEvent, EVENT_ALL_ACCESS, NULL,</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            NotificationEvent, FALSE);</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        Status = ObReferenceObjectByHandle(hEvent, EVENT_ALL_ACCESS, NULL,</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                KernelMode, &amp;pwinsta-&gt;<a class="code" href="a02809.html#afda7868778766e7b9c8cd875b6e83b59">pEventInputReady</a>, NULL);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        ZwClose(hEvent);</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="comment">     * Device and RIT initialization</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="keywordflow">if</span> (!fOneTimeInit &amp;&amp; !<a class="code" href="a00719.html#a5638b444ba56a245b6a06f1c48fdb042">xxxInitWinStaDevices</a>(pwinsta))</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;<span class="comment">     * Create the desktop thread in a suspended state.</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    dti.<a class="code" href="a02813.html#a9e724dc18abf3bc851b0f9896bb843be">pwinsta</a> = pwinsta;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    dti.<a class="code" href="a02813.html#ab5937def8aa0ddb1623ece8ebb09e42a">pEvent</a> = <a class="code" href="a00680.html#abcdcb04a30d72772974e9df4b6f3c442">CreateKernelEvent</a>(SynchronizationEvent, FALSE);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">if</span> (dti.<a class="code" href="a02813.html#ab5937def8aa0ddb1623ece8ebb09e42a">pEvent</a> == NULL) {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    }</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    Status = <a class="code" href="a00680.html#a2dc9a37319c0687eaf57b62a7f1ada4e">CreateSystemThread</a>((PKSTART_ROUTINE)<a class="code" href="a00656.html#ae80399bc7b524a5adc779815db725fb0">DesktopThread</a>, &amp;dti,</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;            &amp;hThreadDesktop);</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        UserFreePool(dti.<a class="code" href="a02813.html#ab5937def8aa0ddb1623ece8ebb09e42a">pEvent</a>);</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    }</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    ZwClose(hThreadDesktop);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    KeWaitForSingleObject(dti.<a class="code" href="a02813.html#ab5937def8aa0ddb1623ece8ebb09e42a">pEvent</a>, WrUserRequest, KernelMode, FALSE, NULL);</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    UserFreePool(dti.<a class="code" href="a02813.html#ab5937def8aa0ddb1623ece8ebb09e42a">pEvent</a>);</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment">     * Switch ppi values so window will be created using the</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment">     * system&#39;s desktop window class.</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a>-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp; W32PF_CLASSESREGISTERED);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    ppiSave = ptiCurrent-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a> = pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a>-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>;</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="comment">     * Create the desktop owner window</span></div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    pdeskTemp = ptiCurrent-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>;            <span class="comment">/* save current desktop */</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    hdeskTemp = ptiCurrent-&gt;<a class="code" href="a02889.html#a31f49a32b10c9938de1f50927e1b7e23">hdesk</a>;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordflow">if</span> (pdeskTemp)</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        ObReferenceObject(pdeskTemp);</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <a class="code" href="a00656.html#adab7753eb3b9c19ddc0f7e5218d350fc">SetDesktop</a>(ptiCurrent, NULL, NULL);</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="comment">     * HACK HACK HACK!!! (adams) In order to create the desktop window</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<span class="comment">     * with the correct desktop, we set the desktop of the current thread</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="comment">     * to the new desktop. But in so doing we allow hooks on the current</span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="comment">     * thread to also hook this new desktop. This is bad, because we don&#39;t</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;<span class="comment">     * want the desktop window to be hooked while it is created. So we</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="comment">     * temporarily disable hooks of the current thread and desktop, and</span></div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;<span class="comment">     * reenable them after switching back to the original desktop.</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    dwDisableHooks = ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DISABLEHOOKS;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_DISABLEHOOKS;</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    Lock(&amp;(pwinsta-&gt;<a class="code" href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">spwndDesktopOwner</a>),</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;            xxxCreateWindowEx((<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)0,</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;            (<a class="code" href="a02449.html">PLARGE_STRING</a>)MAKEINTRESOURCE(DESKTOPCLASS),</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;            NULL, (WS_POPUP | WS_CLIPCHILDREN), 0, 0,</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;            0x10000, 0x10000, NULL, NULL, <a class="code" href="a03257.html#a4ae1966258068576cf2be4cc7356924b">hModuleWin</a>, (LPWSTR)NULL, VER31));</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160; </div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DISABLEHOOKS);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> = (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; ~TIF_DISABLEHOOKS) | dwDisableHooks;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160; </div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">spwndDesktopOwner</a> != NULL) {</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        SetWF(pwinsta-&gt;<a class="code" href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">spwndDesktopOwner</a>, WFVISIBLE);</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;        <a class="code" href="a00695.html#a99a19d6e11271838fb69c8ec954d64f1">HMChangeOwnerThread</a>(pwinsta-&gt;<a class="code" href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">spwndDesktopOwner</a>, pwinsta-&gt;<a class="code" href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">ptiDesktop</a>);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    }</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160; </div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="comment">     * Restore caller&#39;s ppi</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a> = ppiSave;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160; </div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;<span class="comment">     * Restore the previous desktop</span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <a class="code" href="a00656.html#adab7753eb3b9c19ddc0f7e5218d350fc">SetDesktop</a>(ptiCurrent, pdeskTemp, hdeskTemp);</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <span class="keywordflow">if</span> (pdeskTemp)</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;        ObDereferenceObject(pdeskTemp);</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">spwndDesktopOwner</a> == NULL) {</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    }</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160; </div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    fOneTimeInit = TRUE;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;<span class="comment">     * If this is the visible windowstation, assign it to</span></div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="comment">     * the server and create the desktop switch notification</span></div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;<span class="comment">     * event.</span></div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keywordflow">if</span> (!(pwinsta-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp; WSF_NOIO)) {</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;        UNICODE_STRING strName;</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        HANDLE hRootDir;</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;        OBJECT_ATTRIBUTES obja;</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160; </div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<span class="comment">         * Create desktop switch notification event.</span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        ulLengthSid = RtlLengthSid(SeExports-&gt;SeWorldSid);</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;        ulLength = ulLengthSid + <span class="keyword">sizeof</span>(ACE_HEADER) + <span class="keyword">sizeof</span>(ACCESS_MASK);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160; </div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="comment">         * Allocate the ACE list</span></div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        paceList = (PACCESS_ALLOWED_ACE)UserAllocPoolWithQuota(ulLength, TAG_SYSTEM);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <span class="keywordflow">if</span> (paceList == NULL) {</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;            <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        }</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160; </div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;<span class="comment">         * Initialize ACE 0</span></div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        pace = paceList;</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        pace-&gt;Header.AceType = ACCESS_ALLOWED_ACE_TYPE;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        pace-&gt;Header.AceSize = (USHORT)ulLength;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        pace-&gt;Header.AceFlags = 0;</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        pace-&gt;Mask = SYNCHRONIZE;</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        RtlCopySid(ulLengthSid, &amp;pace-&gt;SidStart, SeExports-&gt;SeWorldSid);</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160; </div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;<span class="comment">         * Create the SD</span></div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        psd = <a class="code" href="a00839.html#a56fbb1227212dadeed7bcf9764bcb0bf">CreateSecurityDescriptor</a>(paceList, 1, ulLength, FALSE);</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;        UserFreePool(paceList);</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160; </div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;<span class="comment">         * Create the named event.</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        RtlInitUnicodeString(&amp;strName, L<span class="stringliteral">&quot;\\BaseNamedObjects&quot;</span>);</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        InitializeObjectAttributes( &amp;obja,</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;                                    &amp;strName,</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                                    OBJ_CASE_INSENSITIVE,</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                                    NULL,</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;                                    NULL</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;                                    );</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        Status = ZwOpenDirectoryObject( &amp;hRootDir,</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;                                        DIRECTORY_ALL_ACCESS &amp;</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;                                            ~(DELETE | WRITE_DAC | WRITE_OWNER),</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;                                        &amp;obja</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;                                    );</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        <span class="keywordflow">if</span>(NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;            RtlInitUnicodeString(&amp;strName, L<span class="stringliteral">&quot;WinSta0_DesktopSwitch&quot;</span>);</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;            InitializeObjectAttributes(&amp;obja, &amp;strName, OBJ_OPENIF, hRootDir, psd);</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;            Status = ZwCreateEvent(&amp;hEvent, EVENT_ALL_ACCESS, &amp;obja,</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;                    NotificationEvent, FALSE);</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            ZwClose(hRootDir);</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;            <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;                Status = ObReferenceObjectByHandle(hEvent, EVENT_ALL_ACCESS, NULL,</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;                        KernelMode, &amp;pwinsta-&gt;<a class="code" href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">pEventSwitchNotify</a>, NULL);</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;                <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160; </div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;<span class="comment">                     * Attach to the system process and create a handle to the</span></div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;<span class="comment">                     * object.  This will ensure that the object name is retained</span></div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;<span class="comment">                     * when hEvent is closed.  This is simpler than creating a</span></div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;<span class="comment">                     * permanent object, which takes the</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="comment">                     * SeCreatePermanentPrivilege.</span></div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;                    KeAttachProcess(&amp;<a class="code" href="a03257.html#a5bcbaef1c421c1998d7ea053444e3fc2">gpepSystem</a>-&gt;Pcb);</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;                    Status = ObOpenObjectByPointer(</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                            pwinsta-&gt;<a class="code" href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">pEventSwitchNotify</a>,</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;                            0,</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;                            NULL,</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;                            EVENT_ALL_ACCESS,</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;                            NULL,</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;                            KernelMode,</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;                            &amp;pwinsta-&gt;<a class="code" href="a02809.html#a28454439608f1b5501948513679e4f42">hEventSwitchNotify</a>);</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;                    KeDetachProcess();</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;                }</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;                ZwClose(hEvent);</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;            }</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        }</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;            <span class="keywordflow">goto</span> create_error;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;        UserFreePool(psd);</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    }</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160; </div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;<span class="comment">     * Create a handle to the windowstation</span></div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    Status = ObInsertObject(pwinsta, NULL, dwDesiredAccess, 1,</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;            &amp;pwinsta, &amp;hwinsta);</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160; </div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    <span class="keywordflow">if</span> (Status == STATUS_OBJECT_NAME_EXISTS) {</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160; </div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;<span class="comment">         * The windowstation already exists, so deref and leave.</span></div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;        ObDereferenceObject(pwinsta);</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        PSECURITY_DESCRIPTOR psdParent, psdNew;</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;        SECURITY_SUBJECT_CONTEXT Context;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;        POBJECT_DIRECTORY pParentDirectory;</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;        SECURITY_INFORMATION siNew;</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160; </div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;<span class="comment">         * Create security descriptor for the windowstation.</span></div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;<span class="comment">         * ObInsertObject only supports non-container</span></div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;<span class="comment">         * objects, so we must assign our own security descriptor.</span></div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;        SeCaptureSubjectContext(&amp;Context);</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;        SeLockSubjectContext(&amp;Context);</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160; </div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;        pParentDirectory = OBJECT_HEADER_TO_NAME_INFO(</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;                OBJECT_TO_OBJECT_HEADER(pwinsta))-&gt;Directory;</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;        <span class="keywordflow">if</span> (pParentDirectory != NULL)</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;            psdParent = OBJECT_TO_OBJECT_HEADER(pParentDirectory)-&gt;SecurityDescriptor;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;            psdParent = NULL;</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160; </div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;        Status = SeAssignSecurity(</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;                psdParent,</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;                psdCapture,</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;                &amp;psdNew,</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;                TRUE,</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;                &amp;Context,</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;                &amp;<a class="code" href="a03266.html#adc61ef551cf8e713e7f0014b5932ffcd">WinStaMapping</a>,</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;                PagedPool);</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160; </div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;        SeUnlockSubjectContext(&amp;Context);</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;        SeReleaseSubjectContext(&amp;Context);</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160; </div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;            <span class="keywordflow">if</span> (Status == STATUS_ACCESS_DENIED) {</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;                <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;Access denied during object creation&quot;</span>);</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;                <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>,</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;                        <span class="stringliteral">&quot;Can&#39;t create security descriptor! Status = %#lx&quot;</span>,</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;                        Status);</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            }</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160; </div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;<span class="comment">             * Call the security method to copy the security descriptor</span></div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;            siNew = (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;                    DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION);</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;            Status = ObSetSecurityDescriptorInfo(</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;                    pwinsta,</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;                    &amp;siNew,</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;                    psdNew,</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;                    &amp;OBJECT_TO_OBJECT_HEADER(pwinsta)-&gt;SecurityDescriptor,</div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;                    PagedPool,</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;                    &amp;<a class="code" href="a03266.html#adc61ef551cf8e713e7f0014b5932ffcd">WinStaMapping</a>);</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;            SeDeassignSecurity(&amp;psdNew);</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160; </div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;            <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160; </div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;<span class="comment">                 * Put it on the tail of the global windowstation list</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;                ppwinsta = &amp;<a class="code" href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a>;</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                <span class="keywordflow">while</span> (*ppwinsta != NULL)</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;                    ppwinsta = &amp;(*ppwinsta)-&gt;<a class="code" href="a02809.html#acdccfdf2387c6fcf147bba1ee15d5939">rpwinstaNext</a>;</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;                LockWinSta(ppwinsta, pwinsta);</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;            }</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;        }</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;        ObDereferenceObject(pwinsta);</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    }</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160; </div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;        <a class="code" href="a00371.html#a002956db9fb529e159fb441f09f39b42">RIPNTERR0</a>(Status, <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;        hwinsta = NULL;</div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    }</div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160; </div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    <span class="keywordflow">return</span> hwinsta;</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160; </div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;<span class="comment">     * Goto here if an error occurs so things can be cleaned up</span></div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;create_error:</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    ObDereferenceObject(pwinsta);</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;    <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899_source.html#l01761">tagWINDOWSTATION::awchDiacritic</a>, <a class="el" href="a00680_source.html#l00408">CreateKernelEvent()</a>, <a class="el" href="a00839_source.html#l00125">CreateSecurityDescriptor()</a>, <a class="el" href="a00680_source.html#l00107">CreateSystemThread()</a>, <a class="el" href="a00656_source.html#l00049">DesktopThread()</a>, <a class="el" href="a00899_source.html#l01758">tagWINDOWSTATION::dwFlags</a>, <a class="el" href="a00563_source.html#l00175">DWORD</a>, <a class="el" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit()</a>, <a class="el" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>, <a class="el" href="a03257_source.html#l00184">gpepSystem</a>, <a class="el" href="a03257_source.html#l00182">grpwinstaList</a>, <a class="el" href="a00899_source.html#l02289">tagTHREADINFO::hdesk</a>, <a class="el" href="a00899_source.html#l01787">tagWINDOWSTATION::hEventSwitchNotify</a>, <a class="el" href="a00695_source.html#l01537">HMChangeOwnerThread()</a>, <a class="el" href="a03257_source.html#l00324">hModuleWin</a>, <a class="el" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit()</a>, <a class="el" href="a00920_source.html#l00029">lpszStdFormats</a>, <a class="el" href="a00899_source.html#l01792">tagDESKTOPTHREADINIT::pEvent</a>, <a class="el" href="a00899_source.html#l01762">tagWINDOWSTATION::pEventInputReady</a>, <a class="el" href="a00899_source.html#l01782">tagWINDOWSTATION::pEventSwitchNotify</a>, <a class="el" href="a00899_source.html#l01780">tagWINDOWSTATION::pGlobalAtomTable</a>, <a class="el" href="a00920_source.html#l00017">PLAST_ELEM</a>, <a class="el" href="a00899_source.html#l02271">tagTHREADINFO::ppi</a>, <a class="el" href="a00263_source.html#l00526">PtiCurrent()</a>, <a class="el" href="a00899_source.html#l01757">tagWINDOWSTATION::ptiDesktop</a>, <a class="el" href="a00899_source.html#l01760">tagWINDOWSTATION::pwchDiacritic</a>, <a class="el" href="a00899_source.html#l01791">tagDESKTOPTHREADINIT::pwinsta</a>, <a class="el" href="a00371_source.html#l00028">RIP_ERROR</a>, <a class="el" href="a00371_source.html#l00030">RIP_VERBOSE</a>, <a class="el" href="a00371_source.html#l00029">RIP_WARNING</a>, <a class="el" href="a00371_source.html#l00131">RIPMSG0</a>, <a class="el" href="a00371_source.html#l00132">RIPMSG1</a>, <a class="el" href="a00371_source.html#l00134">RIPMSG3</a>, <a class="el" href="a00371_source.html#l00125">RIPNTERR0</a>, <a class="el" href="a00899_source.html#l02288">tagTHREADINFO::rpdesk</a>, <a class="el" href="a00899_source.html#l01746">tagWINDOWSTATION::rpdeskList</a>, <a class="el" href="a00899_source.html#l01747">tagWINDOWSTATION::rpdeskLogon</a>, <a class="el" href="a00899_source.html#l01745">tagWINDOWSTATION::rpwinstaNext</a>, <a class="el" href="a00656_source.html#l02706">SetDesktop()</a>, <a class="el" href="a00899_source.html#l01755">tagWINDOWSTATION::spwndDesktopOwner</a>, <a class="el" href="a00899_source.html#l02294">tagTHREADINFO::TIF_flags</a>, <a class="el" href="a00950_source.html#l00117">UserAssert</a>, <a class="el" href="a00839_source.html#l00029">WinStaMapping</a> , 以及 <a class="el" href="a00719_source.html#l00324">xxxInitWinStaDevices()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l00475">InternalUserCreateWindowStation()</a>, <a class="el" href="a03614_source.html#l00522">NtUserCreateWindowStation()</a> , 以及 <a class="el" href="a00848_source.html#l00025">xxxConnectService()</a>.</p>

</div>
</div>
<a id="acfe8857740e45d3d77811d96376a3887"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acfe8857740e45d3d77811d96376a3887">&#9670;&nbsp;</a></span>xxxSetProcessWindowStation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL xxxSetProcessWindowStation </td>
          <td>(</td>
          <td class="paramtype">HWINSTA&#160;</td>
          <td class="paramname"><em>hwinsta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00723">723</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;{</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a>                    Thread = PsGetCurrentThread();</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;    PEPROCESS                   Process = PsGetCurrentProcess();</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    HWINSTA                     hwinstaDup;</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;    NTSTATUS                    Status;</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a>                ppi;</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a>              pwinsta;</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a>              pwinstaOld;</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;    OBJECT_HANDLE_INFORMATION   ohi;</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;    OBJECT_HANDLE_INFORMATION   ohiOld;</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160; </div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;    <span class="keywordflow">if</span> (Process == NULL) {</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(Process);</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    }</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160; </div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;    <span class="keywordflow">if</span> (Thread == NULL) {</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(Thread);</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;    }</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160; </div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;    ppi = PpiFromProcess(THREAD_TO_PROCESS(Thread));</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160; </div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(ObReferenceObjectByHandle(</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;            hwinsta,</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;            0,</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;            *<a class="code" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>,</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;            KeGetPreviousMode(),</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;            &amp;pwinsta,</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;            &amp;ohi))) {</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;    }</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160; </div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;   <span class="comment">/*</span></div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;<span class="comment">    * Bug 38780. Lock the handle to window station so that an app cannot free the</span></div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="comment">    * this handle by calling  GetProcessWindowStation() &amp; CloseHandle()</span></div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;<span class="comment">    */</span></div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160; </div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;<span class="comment">    * Unprotect the old hwinsta</span></div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;<span class="comment">    */</span></div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a>) {</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;        Status = <a class="code" href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a>(ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a>, FALSE);</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;ProtectHandle(hwinsta (%lx),FALSE) : Failed with Status = %lx\n&quot;</span>,</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;                            ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a>, Status);</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;        }</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;    }</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;<span class="comment">     * Save the WindowStation information</span></div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;    LockWinSta(&amp;ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a>, pwinsta);</div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;    ObDereferenceObject(pwinsta);</div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a> = hwinsta;</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160; </div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;<span class="comment">     * Protect the new Window Station Handle</span></div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;    Status = <a class="code" href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a>(ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a>, TRUE);</div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;        <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;ProtectHandle(hwinsta (%lx),TRUE) : Failed with Status = %lx\n&quot;</span>,</div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;                            ppi-&gt;<a class="code" href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">hwinsta</a>, Status);</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;    }</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;<span class="comment">     * Check the old Atom Manager WindowStation to see if we are</span></div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;<span class="comment">     * changing this process&#39; WindowStation.</span></div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;    <span class="keywordflow">if</span> (Process-&gt;Win32WindowStation) {</div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;<span class="comment">         * Get a pointer to the old WindowStation object to see if it&#39;s</span></div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;<span class="comment">         * the same WindowStation that we are setting.</span></div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;        Status = ObReferenceObjectByHandle(</div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;            Process-&gt;Win32WindowStation,</div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;            0,</div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;            *<a class="code" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>,</div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;            KeGetPreviousMode(),</div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;            &amp;pwinstaOld,</div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;            &amp;ohiOld);</div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;        <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;<span class="comment">             * Are they different WindowStations?  If so, NULL out the</span></div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;<span class="comment">             * atom manager cache so we will reset it below.</span></div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;            <span class="keywordflow">if</span> (pwinsta != pwinstaOld) {</div>
<div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;                ZwClose(Process-&gt;Win32WindowStation);</div>
<div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;                Process-&gt;Win32WindowStation = NULL;</div>
<div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;            }</div>
<div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160;            ObDereferenceObject(pwinstaOld);</div>
<div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160; </div>
<div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;<span class="comment">             * Their Atom Manager handle is bad?  Give them a new one.</span></div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;            Process-&gt;Win32WindowStation = NULL;</div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;<span class="preprocessor">#ifdef DBG</span></div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;                    <span class="stringliteral">&quot;SetProcessWindowStation: Couldn&#39;t reference old WindowStation (0x%X) Status=0x%X&quot;</span>,</div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;                    Process-&gt;Win32WindowStation,</div>
<div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;                    Status);</div>
<div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160;        }</div>
<div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;    }</div>
<div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160; </div>
<div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;<span class="comment">     * Duplicate the WindowStation handle and stash it in the atom</span></div>
<div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160;<span class="comment">     * manager&#39;s cache (Process-&gt;Win32WindowStation).  We duplicate</span></div>
<div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;<span class="comment">     * the handle in case</span></div>
<div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;    <span class="keywordflow">if</span> (Process-&gt;Win32WindowStation == NULL) {</div>
<div class="line"><a name="l00835"></a><span class="lineno">  835</span>&#160;        Status = <a class="code" href="a00656.html#af8b1a0879c1827947b95aee14a404c5a">xxxUserDuplicateObject</a>(</div>
<div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;                     NtCurrentProcess(),</div>
<div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160;                     hwinsta,</div>
<div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;                     NtCurrentProcess(),</div>
<div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;                     &amp;hwinstaDup,</div>
<div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160;                     0,</div>
<div class="line"><a name="l00841"></a><span class="lineno">  841</span>&#160;                     0,</div>
<div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;                     DUPLICATE_SAME_ACCESS);</div>
<div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160; </div>
<div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;        <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;            Process-&gt;Win32WindowStation = hwinstaDup;</div>
<div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;        }</div>
<div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160;<span class="preprocessor">#ifdef DBG</span></div>
<div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;                    <span class="stringliteral">&quot;SetProcessWindowStation: Couldn&#39;t duplicate WindowStation handle (0x%X) Status=0x%X&quot;</span>,</div>
<div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;                    hwinsta,</div>
<div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;                    Status);</div>
<div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;        }</div>
<div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;    }</div>
<div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160; </div>
<div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a31c3805f3b611723d2ce7b28d87c6859">amwinsta</a> = ohi.GrantedAccess;</div>
<div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160; </div>
<div class="line"><a name="l00859"></a><span class="lineno">  859</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00860"></a><span class="lineno">  860</span>&#160;<span class="comment">     * Cache WSF_NOIO flag in the W32PROCESS so that GDI can access it.</span></div>
<div class="line"><a name="l00861"></a><span class="lineno">  861</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00862"></a><span class="lineno">  862</span>&#160;    <span class="keywordflow">if</span> (pwinsta-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp; WSF_NOIO) {</div>
<div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;        ppi-&gt;W32PF_Flags &amp;= ~W32PF_IOWINSTA;</div>
<div class="line"><a name="l00864"></a><span class="lineno">  864</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00865"></a><span class="lineno">  865</span>&#160;        ppi-&gt;W32PF_Flags |= W32PF_IOWINSTA;</div>
<div class="line"><a name="l00866"></a><span class="lineno">  866</span>&#160;    }</div>
<div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160; </div>
<div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;<span class="comment">     * Do the access check now for readscreen so that</span></div>
<div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;<span class="comment">     * blts off of the display will be as fast as possible.</span></div>
<div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;    <span class="keywordflow">if</span> (RtlAreAllAccessesGranted(ohi.GrantedAccess, WINSTA_READSCREEN)) {</div>
<div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;        ppi-&gt;W32PF_Flags |= W32PF_READSCREENACCESSGRANTED;</div>
<div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;        ppi-&gt;W32PF_Flags &amp;= ~W32PF_READSCREENACCESSGRANTED;</div>
<div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160;    }</div>
<div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160; </div>
<div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00879"></a><span class="lineno">  879</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899_source.html#l02401">tagPROCESSINFO::amwinsta</a>, <a class="el" href="a00899_source.html#l01758">tagWINDOWSTATION::dwFlags</a>, <a class="el" href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a>, <a class="el" href="a00899_source.html#l02400">tagPROCESSINFO::hwinsta</a>, <a class="el" href="a00680_source.html#l00591">ProtectHandle()</a>, <a class="el" href="a00371_source.html#l00029">RIP_WARNING</a>, <a class="el" href="a00371_source.html#l00133">RIPMSG2</a>, <a class="el" href="a00899_source.html#l02399">tagPROCESSINFO::rpwinsta</a>, <a class="el" href="a00950_source.html#l00117">UserAssert</a> , 以及 <a class="el" href="a00656_source.html#l02977">xxxUserDuplicateObject()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l00799">NtUserSetProcessWindowStation()</a> , 以及 <a class="el" href="a00824_source.html#l00933">xxxCreateThreadInfo()</a>.</p>

</div>
</div>
<h2 class="groupheader">变量说明</h2>
<a id="a8d75c1089327cdddcdff3c2a4890395d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d75c1089327cdddcdff3c2a4890395d">&#9670;&nbsp;</a></span>lpszStdFormats</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">LPCWSTR lpszStdFormats[]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>初始值:</b><div class="fragment"><div class="line">= {</div>
<div class="line">    L<span class="stringliteral">&quot;StdExit&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdNewDocument&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdOpenDocument&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdEditDocument&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdNewfromTemplate&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdCloseDocument&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdShowItem&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdDoVerbItem&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;System&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;OLEsystem&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;StdDocumentName&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Protocols&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Topics&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Formats&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Status&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;EditEnvItems&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;True&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;False&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Change&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Save&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;Close&quot;</span>,</div>
<div class="line">    L<span class="stringliteral">&quot;MSDraw&quot;</span>,</div>
<div class="line">    NULL</div>
<div class="line">}</div>
</div><!-- fragment -->
<p class="definition">在文件 <a class="el" href="a00920_source.html">winsta.c</a> 第 <a class="el" href="a00920_source.html#l00029">29</a> 行定义.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00920_source.html#l00055">xxxCreateWindowStation()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa02889_html_ae8b869ec5b101646649020f5b0fd5d0d"><div class="ttname"><a href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">tagTHREADINFO::TIF_flags</a></div><div class="ttdeci">DWORD TIF_flags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02294">userk.h:2294</a></div></div>
<div class="ttc" id="aa00920_html_a8d75c1089327cdddcdff3c2a4890395d"><div class="ttname"><a href="a00920.html#a8d75c1089327cdddcdff3c2a4890395d">lpszStdFormats</a></div><div class="ttdeci">static LPCWSTR lpszStdFormats[]</div><div class="ttdef"><b>Definition:</b> <a href="a00920_source.html#l00029">winsta.c:29</a></div></div>
<div class="ttc" id="aa00371_html_a01c4659626880ba56745765a3580a36b"><div class="ttname"><a href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a></div><div class="ttdeci">#define RIPMSG0(flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00131">winerrp.h:131</a></div></div>
<div class="ttc" id="aa00725_html_a5618df359d17a210e0812e1bd431d43f"><div class="ttname"><a href="a00725.html#a5618df359d17a210e0812e1bd431d43f">xxxFreeKeyboardLayouts</a></div><div class="ttdeci">VOID xxxFreeKeyboardLayouts(PWINDOWSTATION pwinsta)</div><div class="ttdef"><b>Definition:</b> <a href="a00725_source.html#l00952">kbdlyout.c:952</a></div></div>
<div class="ttc" id="aa02809_html_acdccfdf2387c6fcf147bba1ee15d5939"><div class="ttname"><a href="a02809.html#acdccfdf2387c6fcf147bba1ee15d5939">tagWINDOWSTATION::rpwinstaNext</a></div><div class="ttdeci">struct tagWINDOWSTATION * rpwinstaNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01745">userk.h:1745</a></div></div>
<div class="ttc" id="aa00656_html_adab7753eb3b9c19ddc0f7e5218d350fc"><div class="ttname"><a href="a00656.html#adab7753eb3b9c19ddc0f7e5218d350fc">SetDesktop</a></div><div class="ttdeci">VOID SetDesktop(PTHREADINFO pti, PDESKTOP pdesk, HDESK hdesk)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l02706">desktop.c:2706</a></div></div>
<div class="ttc" id="aa02809_html_a1a2b3b6fc0e04fcb8253ca5bb00c631e"><div class="ttname"><a href="a02809.html#a1a2b3b6fc0e04fcb8253ca5bb00c631e">tagWINDOWSTATION::pwchDiacritic</a></div><div class="ttdeci">LPWSTR pwchDiacritic</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01760">userk.h:1760</a></div></div>
<div class="ttc" id="aa00839_html_a9f78afc46aa1b978b1ad2b0922e998e1"><div class="ttname"><a href="a00839.html#a9f78afc46aa1b978b1ad2b0922e998e1">AccessCheckObject</a></div><div class="ttdeci">BOOL AccessCheckObject(PVOID pobj, ACCESS_MASK amRequest)</div><div class="ttdef"><b>Definition:</b> <a href="a00839_source.html#l00517">security.c:517</a></div></div>
<div class="ttc" id="aa00899_html_a6b562f476cdc12794cf052fff8d41096"><div class="ttname"><a href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a></div><div class="ttdeci">POBJECT_TYPE * ExDesktopObjectType</div></div>
<div class="ttc" id="aa03257_html_ad4b0bbbb1f1fce28a4e874ae6fb92262"><div class="ttname"><a href="a03257.html#ad4b0bbbb1f1fce28a4e874ae6fb92262">gpidLogon</a></div><div class="ttdeci">HANDLE gpidLogon</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00183">kernel/globals.c:183</a></div></div>
<div class="ttc" id="aa03290_html_a7bb16e9d18954c3ef50ae8bc75f89c5d"><div class="ttname"><a href="a03290.html#a7bb16e9d18954c3ef50ae8bc75f89c5d">_PostThreadMessage</a></div><div class="ttdeci">BOOL _PostThreadMessage(PTHREADINFO pti, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01064">kernel/input.c:1064</a></div></div>
<div class="ttc" id="aa00899_html_ae451a2dc8791c420d7c956a63adc33ba"><div class="ttname"><a href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a></div><div class="ttdeci">VOID EnterCrit(VOID)</div></div>
<div class="ttc" id="aa00656_html_a02f3707bdf26cc51a2b852ba3dc46fd1"><div class="ttname"><a href="a00656.html#a02f3707bdf26cc51a2b852ba3dc46fd1">ParseDesktop</a></div><div class="ttdeci">NTSTATUS ParseDesktop(PVOID pContainerObject, POBJECT_TYPE pObjectType, PACCESS_STATE pAccessState, KPROCESSOR_MODE AccessMode, ULONG Attributes, PUNICODE_STRING pstrCompleteName, PUNICODE_STRING pstrRemainingName, PVOID Context, PSECURITY_QUALITY_OF_SERVICE pqos, PVOID *pObject)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l01596">desktop.c:1596</a></div></div>
<div class="ttc" id="aa02801_html"><div class="ttname"><a href="a02801.html">tagDESKTOP</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01703">userk.h:1703</a></div></div>
<div class="ttc" id="aa02889_html_a31f49a32b10c9938de1f50927e1b7e23"><div class="ttname"><a href="a02889.html#a31f49a32b10c9938de1f50927e1b7e23">tagTHREADINFO::hdesk</a></div><div class="ttdeci">HDESK hdesk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02289">userk.h:2289</a></div></div>
<div class="ttc" id="aa00371_html_ad6b24a3d61abdc148c8751b5c5add686"><div class="ttname"><a href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a></div><div class="ttdeci">#define RIP_VERBOSE</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00030">winerrp.h:30</a></div></div>
<div class="ttc" id="aa02801_html_aa5a1d482d42aa7bc00013ae77771910a"><div class="ttname"><a href="a02801.html#aa5a1d482d42aa7bc00013ae77771910a">tagDESKTOP::dwConsoleThreadId</a></div><div class="ttdeci">DWORD dwConsoleThreadId</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01725">userk.h:1725</a></div></div>
<div class="ttc" id="aa02809_html_a5734cf57c3cd916ca3c74b17b7c6f39e"><div class="ttname"><a href="a02809.html#a5734cf57c3cd916ca3c74b17b7c6f39e">tagWINDOWSTATION::spwndLogonNotify</a></div><div class="ttdeci">struct tagWND * spwndLogonNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01756">userk.h:1756</a></div></div>
<div class="ttc" id="aa02449_html"><div class="ttname"><a href="a02449.html">_LARGE_STRING</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00266">user.h:266</a></div></div>
<div class="ttc" id="aa00371_html_af713eb6f9b50ac607c1fed71a5f678f8"><div class="ttname"><a href="a00371.html#af713eb6f9b50ac607c1fed71a5f678f8">RIPMSG3</a></div><div class="ttdeci">#define RIPMSG3(flags, szFmt, p1, p2, p3)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00134">winerrp.h:134</a></div></div>
<div class="ttc" id="aa00371_html_a162a73e20dfabca084a3ebb4581631a8"><div class="ttname"><a href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a></div><div class="ttdeci">#define UserAssert(exp)</div><div class="ttdef"><b>Definition:</b> <a href="a00950_source.html#l00117">usersrv.h:117</a></div></div>
<div class="ttc" id="aa02809_html_adc5b5ad67d29b5845a72132d802bcae2"><div class="ttname"><a href="a02809.html#adc5b5ad67d29b5845a72132d802bcae2">tagWINDOWSTATION::ptiDesktop</a></div><div class="ttdeci">struct tagTHREADINFO * ptiDesktop</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01757">userk.h:1757</a></div></div>
<div class="ttc" id="aa00371_html_afa5f32de88404289ec03cd2c0e61e94f"><div class="ttname"><a href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a></div><div class="ttdeci">#define RIP_ERROR</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00028">winerrp.h:28</a></div></div>
<div class="ttc" id="aa00371_html_a31aafffb49dfe98bdc749c9b35c90162"><div class="ttname"><a href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a></div><div class="ttdeci">#define RIPMSG1(flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00132">winerrp.h:132</a></div></div>
<div class="ttc" id="aa03257_html_ad9f551216ba73947832de96844110fca"><div class="ttname"><a href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a></div><div class="ttdeci">PWINDOWSTATION grpwinstaList</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00182">kernel/globals.c:182</a></div></div>
<div class="ttc" id="aa00656_html_a3de14821d9e99f6989747d92e181d117"><div class="ttname"><a href="a00656.html#a3de14821d9e99f6989747d92e181d117">TerminateConsole</a></div><div class="ttdeci">VOID TerminateConsole(PDESKTOP pdesk)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l03233">desktop.c:3233</a></div></div>
<div class="ttc" id="aa00257_html_a8315d2c807ba18ba9e528c40614b6173"><div class="ttname"><a href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a></div><div class="ttdeci">PTHREADINFO PtiCurrent(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00263_source.html#l00526">winmgrc.c:526</a></div></div>
<div class="ttc" id="aa02889_html_a215417492fadc11678c689da2447f02e"><div class="ttname"><a href="a02889.html#a215417492fadc11678c689da2447f02e">tagTHREADINFO::ppi</a></div><div class="ttdeci">struct tagPROCESSINFO * ppi</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02271">userk.h:2271</a></div></div>
<div class="ttc" id="aa02809_html_a384d45dfef3f95188b5c7a7a09213d35"><div class="ttname"><a href="a02809.html#a384d45dfef3f95188b5c7a7a09213d35">tagWINDOWSTATION::luidUser</a></div><div class="ttdeci">LUID luidUser</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01784">userk.h:1784</a></div></div>
<div class="ttc" id="aa02889_html_a9e724dc18abf3bc851b0f9896bb843be"><div class="ttname"><a href="a02889.html#a9e724dc18abf3bc851b0f9896bb843be">tagTHREADINFO::pwinsta</a></div><div class="ttdeci">PWINDOWSTATION pwinsta</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02316">userk.h:2316</a></div></div>
<div class="ttc" id="aa00719_html_a5638b444ba56a245b6a06f1c48fdb042"><div class="ttname"><a href="a00719.html#a5638b444ba56a245b6a06f1c48fdb042">xxxInitWinStaDevices</a></div><div class="ttdeci">BOOL xxxInitWinStaDevices(PWINDOWSTATION pwinsta)</div><div class="ttdef"><b>Definition:</b> <a href="a00719_source.html#l00324">init.c:324</a></div></div>
<div class="ttc" id="aa00371_html_ae61d954062a9ece52e350e54cad9a23d"><div class="ttname"><a href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a></div><div class="ttdeci">#define RIPERR0(idErr, flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00119">winerrp.h:119</a></div></div>
<div class="ttc" id="aa02813_html_a9e724dc18abf3bc851b0f9896bb843be"><div class="ttname"><a href="a02813.html#a9e724dc18abf3bc851b0f9896bb843be">tagDESKTOPTHREADINIT::pwinsta</a></div><div class="ttdeci">PWINDOWSTATION pwinsta</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01791">userk.h:1791</a></div></div>
<div class="ttc" id="aa02809_html"><div class="ttname"><a href="a02809.html">tagWINDOWSTATION</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01744">userk.h:1744</a></div></div>
<div class="ttc" id="aa02809_html_a231342040f95d083ca5ec2bdd1ddd178"><div class="ttname"><a href="a02809.html#a231342040f95d083ca5ec2bdd1ddd178">tagWINDOWSTATION::psidUser</a></div><div class="ttdeci">PSID psidUser</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01785">userk.h:1785</a></div></div>
<div class="ttc" id="aa02809_html_a5166c7e2801426372e7bcc24c1df7007"><div class="ttname"><a href="a02809.html#a5166c7e2801426372e7bcc24c1df7007">tagWINDOWSTATION::pGlobalAtomTable</a></div><div class="ttdeci">PVOID pGlobalAtomTable</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01780">userk.h:1780</a></div></div>
<div class="ttc" id="aa02809_html_a4d2f405b1141000eb2af256e0fc8b98b"><div class="ttname"><a href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">tagWINDOWSTATION::dwFlags</a></div><div class="ttdeci">DWORD dwFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01758">userk.h:1758</a></div></div>
<div class="ttc" id="aa00563_html_a074685e97e89d6aa2accdfcb82328699"><div class="ttname"><a href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a></div><div class="ttdeci">ddeml v[i&lt; inst &gt;][t&lt; type &gt;][hObj|pObj] Dump DDEML state information ddeml lists all ddeml instances for this process n ddeml t&lt; type &gt; lists all ddeml objects of the given type n n assumes link is first DWORD</div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00175">exts.h:175</a></div></div>
<div class="ttc" id="aa02905_html_a2e9b45810a903e10ff54b54e151a0c7e"><div class="ttname"><a href="a02905.html#a2e9b45810a903e10ff54b54e151a0c7e">tagPROCESSINFO::hwinsta</a></div><div class="ttdeci">HWINSTA hwinsta</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02400">userk.h:2400</a></div></div>
<div class="ttc" id="aa02813_html"><div class="ttname"><a href="a02813.html">tagDESKTOPTHREADINIT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01790">userk.h:1790</a></div></div>
<div class="ttc" id="aa00680_html_a481c734b3eea8139a042653549741891"><div class="ttname"><a href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a></div><div class="ttdeci">NTSTATUS ProtectHandle(IN HANDLE Handle, IN BOOLEAN Protect)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00591">ex.c:591</a></div></div>
<div class="ttc" id="aa02809_html_a76dc14d7f6c3367ceff4227fafd47b97"><div class="ttname"><a href="a02809.html#a76dc14d7f6c3367ceff4227fafd47b97">tagWINDOWSTATION::spwndDesktopOwner</a></div><div class="ttdeci">struct tagWND * spwndDesktopOwner</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01755">userk.h:1755</a></div></div>
<div class="ttc" id="aa03257_html_a5bcbaef1c421c1998d7ea053444e3fc2"><div class="ttname"><a href="a03257.html#a5bcbaef1c421c1998d7ea053444e3fc2">gpepSystem</a></div><div class="ttdeci">PEPROCESS gpepSystem</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00184">kernel/globals.c:184</a></div></div>
<div class="ttc" id="aa00695_html_a99a19d6e11271838fb69c8ec954d64f1"><div class="ttname"><a href="a00695.html#a99a19d6e11271838fb69c8ec954d64f1">HMChangeOwnerThread</a></div><div class="ttdeci">VOID HMChangeOwnerThread(PVOID pobj, PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00695_source.html#l01537">handtabl.c:1537</a></div></div>
<div class="ttc" id="aa03266_html_adc61ef551cf8e713e7f0014b5932ffcd"><div class="ttname"><a href="a03266.html#adc61ef551cf8e713e7f0014b5932ffcd">WinStaMapping</a></div><div class="ttdeci">GENERIC_MAPPING WinStaMapping</div><div class="ttdef"><b>Definition:</b> <a href="a00839_source.html#l00029">security.c:29</a></div></div>
<div class="ttc" id="aa00839_html_a56fbb1227212dadeed7bcf9764bcb0bf"><div class="ttname"><a href="a00839.html#a56fbb1227212dadeed7bcf9764bcb0bf">CreateSecurityDescriptor</a></div><div class="ttdeci">PSECURITY_DESCRIPTOR CreateSecurityDescriptor(PACCESS_ALLOWED_ACE paceList, DWORD cAce, DWORD cbAce, BOOLEAN fDaclDefaulted)</div><div class="ttdef"><b>Definition:</b> <a href="a00839_source.html#l00125">security.c:125</a></div></div>
<div class="ttc" id="aa02905_html_a1899acfa354d8b3a6a8e69f7a1f781af"><div class="ttname"><a href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">tagPROCESSINFO::rpwinsta</a></div><div class="ttdeci">struct tagWINDOWSTATION * rpwinsta</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02399">userk.h:2399</a></div></div>
<div class="ttc" id="aa02905_html"><div class="ttname"><a href="a02905.html">tagPROCESSINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02386">userk.h:2386</a></div></div>
<div class="ttc" id="aa00371_html_a41f433389f20db57f042022a662e96de"><div class="ttname"><a href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a></div><div class="ttdeci">#define RIP_WARNING</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00029">winerrp.h:29</a></div></div>
<div class="ttc" id="aa02809_html_ae2b5d692d111668887615069be07738c"><div class="ttname"><a href="a02809.html#ae2b5d692d111668887615069be07738c">tagWINDOWSTATION::awchDiacritic</a></div><div class="ttdeci">WCHAR awchDiacritic[5]</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01761">userk.h:1761</a></div></div>
<div class="ttc" id="aa02801_html_ace92d08d0736aef3f0b73273a6e3e5f7"><div class="ttname"><a href="a02801.html#ace92d08d0736aef3f0b73273a6e3e5f7">tagDESKTOP::rpdeskNext</a></div><div class="ttdeci">struct tagDESKTOP * rpdeskNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01709">userk.h:1709</a></div></div>
<div class="ttc" id="aa02809_html_a28454439608f1b5501948513679e4f42"><div class="ttname"><a href="a02809.html#a28454439608f1b5501948513679e4f42">tagWINDOWSTATION::hEventSwitchNotify</a></div><div class="ttdeci">HANDLE hEventSwitchNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01787">userk.h:1787</a></div></div>
<div class="ttc" id="aa00656_html_af8b1a0879c1827947b95aee14a404c5a"><div class="ttname"><a href="a00656.html#af8b1a0879c1827947b95aee14a404c5a">xxxUserDuplicateObject</a></div><div class="ttdeci">NTSTATUS xxxUserDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l02977">desktop.c:2977</a></div></div>
<div class="ttc" id="aa00899_html_a23e8283bc242953b172d97079c117f38"><div class="ttname"><a href="a00899.html#a23e8283bc242953b172d97079c117f38">ExWindowStationObjectType</a></div><div class="ttdeci">POBJECT_TYPE * ExWindowStationObjectType</div></div>
<div class="ttc" id="aa00680_html_a2dc9a37319c0687eaf57b62a7f1ada4e"><div class="ttname"><a href="a00680.html#a2dc9a37319c0687eaf57b62a7f1ada4e">CreateSystemThread</a></div><div class="ttdeci">NTSTATUS CreateSystemThread(PKSTART_ROUTINE lpThreadAddress, PVOID pvContext, PHANDLE phThread)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00107">ex.c:107</a></div></div>
<div class="ttc" id="aa02597_html_a0bb800c1cd2c6393f736881f24ae7ec7"><div class="ttname"><a href="a02597.html#a0bb800c1cd2c6393f736881f24ae7ec7">tagNAMELIST::cNames</a></div><div class="ttdeci">DWORD cNames</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01528">user.h:1528</a></div></div>
<div class="ttc" id="aa02813_html_ab5937def8aa0ddb1623ece8ebb09e42a"><div class="ttname"><a href="a02813.html#ab5937def8aa0ddb1623ece8ebb09e42a">tagDESKTOPTHREADINIT::pEvent</a></div><div class="ttdeci">PKEVENT pEvent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01792">userk.h:1792</a></div></div>
<div class="ttc" id="aa03257_html_ac6b62aff5aa60b8f170320cd7c3f32d7"><div class="ttname"><a href="a03257.html#ac6b62aff5aa60b8f170320cd7c3f32d7">gpresUser</a></div><div class="ttdeci">PERESOURCE gpresUser</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00169">kernel/globals.c:169</a></div></div>
<div class="ttc" id="aa02809_html_aafbda282c78d875d4491cf817366dc1b"><div class="ttname"><a href="a02809.html#aafbda282c78d875d4491cf817366dc1b">tagWINDOWSTATION::rpdeskList</a></div><div class="ttdeci">struct tagDESKTOP * rpdeskList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01746">userk.h:1746</a></div></div>
<div class="ttc" id="aa02889_html_abb1184e0c5805b5ad89b79dcc2bd17c8"><div class="ttname"><a href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">tagTHREADINFO::rpdesk</a></div><div class="ttdeci">PDESKTOP rpdesk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02288">userk.h:2288</a></div></div>
<div class="ttc" id="aa02809_html_afda7868778766e7b9c8cd875b6e83b59"><div class="ttname"><a href="a02809.html#afda7868778766e7b9c8cd875b6e83b59">tagWINDOWSTATION::pEventInputReady</a></div><div class="ttdeci">PKEVENT pEventInputReady</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01762">userk.h:1762</a></div></div>
<div class="ttc" id="aa00920_html_ac07546c3d3bba861938e75c5a88cd9cd"><div class="ttname"><a href="a00920.html#ac07546c3d3bba861938e75c5a88cd9cd">PLAST_ELEM</a></div><div class="ttdeci">#define PLAST_ELEM(a)</div><div class="ttdef"><b>Definition:</b> <a href="a00920_source.html#l00017">winsta.c:17</a></div></div>
<div class="ttc" id="aa00899_html_ac2181d07596893ed44d18aa267ce4d23"><div class="ttname"><a href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a></div><div class="ttdeci">VOID LeaveCrit(VOID)</div></div>
<div class="ttc" id="aa00920_html_a71df3543eaf0197b0e7f280be312c854"><div class="ttname"><a href="a00920.html#a71df3543eaf0197b0e7f280be312c854">ReferenceWindowStation</a></div><div class="ttdeci">NTSTATUS ReferenceWindowStation(PETHREAD Thread, HWINSTA hwinsta, ACCESS_MASK amDesiredAccess, PWINDOWSTATION *ppwinsta, BOOL fUseDesktop)</div><div class="ttdef"><b>Definition:</b> <a href="a00920_source.html#l00999">winsta.c:999</a></div></div>
<div class="ttc" id="aa02809_html_ab47ad82730b6b8c717b1444a018bc499"><div class="ttname"><a href="a02809.html#ab47ad82730b6b8c717b1444a018bc499">tagWINDOWSTATION::rpdeskLogon</a></div><div class="ttdeci">struct tagDESKTOP * rpdeskLogon</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01747">userk.h:1747</a></div></div>
<div class="ttc" id="aa00365_html_abce9368ed5b93dc4c0e3e9cc7c99157b"><div class="ttname"><a href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a></div><div class="ttdeci">struct _ETHREAD * PETHREAD</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00060">user.h:60</a></div></div>
<div class="ttc" id="aa00680_html_abcdcb04a30d72772974e9df4b6f3c442"><div class="ttname"><a href="a00680.html#abcdcb04a30d72772974e9df4b6f3c442">CreateKernelEvent</a></div><div class="ttdeci">PKEVENT CreateKernelEvent(IN EVENT_TYPE Type, IN BOOLEAN State)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00408">ex.c:408</a></div></div>
<div class="ttc" id="aa00632_html_a597334dbd8f7414342f9b405aef21c9e"><div class="ttname"><a href="a00632.html#a597334dbd8f7414342f9b405aef21c9e">ForceEmptyClipboard</a></div><div class="ttdeci">VOID ForceEmptyClipboard(PWINDOWSTATION pwinsta)</div><div class="ttdef"><b>Definition:</b> <a href="a00632_source.html#l02189">clipbrd.c:2189</a></div></div>
<div class="ttc" id="aa00371_html_adbdd8355d15a97b6f3a9e4766e6a2cc1"><div class="ttname"><a href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a></div><div class="ttdeci">#define RIPERR1(idErr, flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00120">winerrp.h:120</a></div></div>
<div class="ttc" id="aa02889_html"><div class="ttname"><a href="a02889.html">tagTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02260">userk.h:2260</a></div></div>
<div class="ttc" id="aa00656_html_ae80399bc7b524a5adc779815db725fb0"><div class="ttname"><a href="a00656.html#ae80399bc7b524a5adc779815db725fb0">DesktopThread</a></div><div class="ttdeci">VOID DesktopThread(PDESKTOPTHREADINIT pdti)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l00049">desktop.c:49</a></div></div>
<div class="ttc" id="aa00371_html_a906cb0845450a5d5422ce513ecd8a32f"><div class="ttname"><a href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a></div><div class="ttdeci">#define RIPMSG2(flags, szFmt, p1, p2)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00133">winerrp.h:133</a></div></div>
<div class="ttc" id="aa02597_html_a9ed6a30359da8299f730bdf76bc44dbb"><div class="ttname"><a href="a02597.html#a9ed6a30359da8299f730bdf76bc44dbb">tagNAMELIST::cb</a></div><div class="ttdeci">DWORD cb</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01527">user.h:1527</a></div></div>
<div class="ttc" id="aa02905_html_a31c3805f3b611723d2ce7b28d87c6859"><div class="ttname"><a href="a02905.html#a31c3805f3b611723d2ce7b28d87c6859">tagPROCESSINFO::amwinsta</a></div><div class="ttdeci">ACCESS_MASK amwinsta</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02401">userk.h:2401</a></div></div>
<div class="ttc" id="aa02801_html_aec6cab8a48f05b1fd77850a34109675e"><div class="ttname"><a href="a02801.html#aec6cab8a48f05b1fd77850a34109675e">tagDESKTOP::rpwinstaParent</a></div><div class="ttdeci">struct tagWINDOWSTATION * rpwinstaParent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01710">userk.h:1710</a></div></div>
<div class="ttc" id="aa02809_html_a29ed7a8f82ae2d11deecfeb618baa499"><div class="ttname"><a href="a02809.html#a29ed7a8f82ae2d11deecfeb618baa499">tagWINDOWSTATION::pEventSwitchNotify</a></div><div class="ttdeci">PKEVENT pEventSwitchNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01782">userk.h:1782</a></div></div>
<div class="ttc" id="aa02597_html_ab21ea6b07c2a49792115c1f21706a251"><div class="ttname"><a href="a02597.html#ab21ea6b07c2a49792115c1f21706a251">tagNAMELIST::awchNames</a></div><div class="ttdeci">WCHAR awchNames[1]</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01529">user.h:1529</a></div></div>
<div class="ttc" id="aa00371_html_a002956db9fb529e159fb441f09f39b42"><div class="ttname"><a href="a00371.html#a002956db9fb529e159fb441f09f39b42">RIPNTERR0</a></div><div class="ttdeci">#define RIPNTERR0(idErr, flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00125">winerrp.h:125</a></div></div>
<div class="ttc" id="aa03257_html_a4ae1966258068576cf2be4cc7356924b"><div class="ttname"><a href="a03257.html#a4ae1966258068576cf2be4cc7356924b">hModuleWin</a></div><div class="ttdeci">HANDLE hModuleWin</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00324">kernel/globals.c:324</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_cd70cb5eb491250157f2d55d3ff4b13e.html">backup</a></li><li class="navelem"><a class="el" href="dir_ba2b673b566ba104b956abdc6dec0552.html">org</a></li><li class="navelem"><a class="el" href="dir_5bb0003d7907b45051943541418399f5.html">ntuser</a></li><li class="navelem"><a class="el" href="dir_2a0a56546b70a0973705719e6a88eab3.html">kernel</a></li><li class="navelem"><a class="el" href="a00920.html">winsta.c</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
